/**
 * Abstract class that builds a Road Map of a section of Westwood.
 * Location: North-East of the I-405 and I-10 interchange.
 * @author Jared Lindbl�m
 */
public abstract class WestwoodMap {

	/**
	 * Creates a Road Map of a section of Westwood.
	 * @param map	The Road Map to create.
	 */
	public static void createMap(RoadMap map) {
		String[] NorthSouth = {"Prosser Ave", "Parnell Ave", "Manning Ave", "Pelham Ave",
				"Overland Ave", "Selby Ave", "Malcom Ave", "Glendon Ave",
				"Westwood Blvd", "Midvale Ave", "Kelton Ave", "Veteran Ave",
				"Greenfield Ave", "Camden Ave", "Bentley Ave", "Sepulveda Blvd"};

//		String[] NorthSouth = {"Malcom Ave", "Glendon Ave",
//				"Westwood Blvd"};
//		
		double[] NorthSouthDistances = {10.0, 10.0, 10.0, 10.0,
				10.0, 10.0, 10.0, 10.0,
				10.0, 10.0, 10.0, 10.0,
				10.0, 10.0, 10.0, 10.0};

		int[] NorthSouthMaxVehicles = {10, 10, 10, 10,
				10, 10, 10, 10,
				10, 10, 10, 10,
				10, 10, 10, 10};

		String[] EastWest = {"Santa Monica Blvd", "Missouri Ave", "La Grange Ave", "Mississippi Ave",
				"Olympic Blvd", "Tennessee Ave", "Pico Blvd"};
		
		//String[] EastWest = {"Pico Blvd", "Tennessee Ave", "Olympic Blvd",  "Mississippi Ave", "La Grange Ave", "Missouri Ave", "Santa Monica Blvd"};
				
		//String[] EastWest = {"Santa Monica Blvd", "Missouri Ave", "La Grange Ave"};
				

		double[] EastWestDistances = {10.0, 10.0, 10.0, 10.0,
				10.0, 10.0, 10.0};

		int[] EastWestMaxVehicles = {10, 10, 10, 10,
				10, 10, 10};

		for (int i = 0; i < NorthSouth.length; i++) {
			map.addRoad(NorthSouth[i], new NorthSouthRoad(NorthSouth[i], NorthSouthDistances[i], NorthSouthMaxVehicles[i], map.getMetric()));
		}

		for (int i = 0; i < EastWest.length; i++) {
			map.addRoad(EastWest[i], new EastWestRoad(EastWest[i], EastWestDistances[i], EastWestMaxVehicles[i], map.getMetric()));
		}

		for (int i = 0; i < NorthSouth.length; i++) {
			for (int j = 0; j < EastWest.length; j++) {
				map.addIntersection(NorthSouth[i] + "/" + EastWest[j], new Intersection(NorthSouth[i] + "/" + EastWest[j]));
				(map.getIntersection(NorthSouth[i] + "/" + EastWest[j])).addRoad(map.getRoad(NorthSouth[i]));
				(map.getIntersection(NorthSouth[i] + "/" + EastWest[j])).addRoad(map.getRoad(EastWest[j]));
				(map.getRoad(NorthSouth[i])).addIntersection(map.getIntersection(NorthSouth[i] + "/" + EastWest[j]));
				(map.getRoad(EastWest[j])).addIntersection(map.getIntersection(NorthSouth[i] + "/" + EastWest[j]));
			}
		}
		
		//Generate Road Sections
		if (map.generateSections())
			System.out.println("Generate Sections Passed!");
		else
			System.out.println("Generate Sections Failed!");
		
		System.out.println();
	}
}